﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="Register.aspx.cs" Inherits="AirplaneReservation.Register" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
    .style1
    {
        width: 127px;
    }
    .style2
    {
        }
    .style3
    {
    }
    .style4
    {
        width: 267px;
    }
        .style5
        {
            width: 272px;
        }
        .style6
        {
            width: 264px;
        }
        </style>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderLeft" runat="server">
    <table style="width:100%;">
        <tr>
            <td>
                <asp:Panel ID="Panel1" runat="server">
                    <table style="width:100%;" cellpadding="3px"; cellspacing="3px">
                        <tr>
                            <td align="center" class="style3" colspan="2" 
                style="font-weight: bold; font-size: x-large; color: #CC99FF">
                                -- Sign Up for Your New Account --</td>
                        </tr>
                        <tr>
                            <td align="right" class="style7" style="width:50%">
                                User Name</td>
                            <td class="style2">
                                <asp:TextBox ID="txtUser" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                                    ControlToValidate="txtUser" ErrorMessage="*" 
                    ForeColor="Red" ValidationGroup="signup" Display="Dynamic"></asp:RequiredFieldValidator>
                                <asp:CustomValidator ID="CustomValidator2" runat="server" 
                                    ControlToValidate="txtUser" Display="Dynamic" 
                                    ErrorMessage="Username aldready exists" ForeColor="Red" 
                                    onservervalidate="CustomValidator2_ServerValidate" ValidationGroup="signup"></asp:CustomValidator>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="style7">
                                Password</td>
                            <td class="style2">
                                <asp:TextBox ID="txtPassword" runat="server" 
                    TextMode="Password"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                                    ControlToValidate="txtPassword" ErrorMessage="*" 
                    ForeColor="Red" ValidationGroup="signup"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="style7">
                                First Name</td>
                            <td class="style2">
                                <asp:TextBox ID="txtFirstN" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                                    ControlToValidate="txtFirstN" ErrorMessage="*" 
                    ForeColor="Red" ValidationGroup="signup"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="style7">
                                Last Name</td>
                            <td class="style2">
                                <asp:TextBox ID="txtLastN" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                                    ControlToValidate="txtLastN" ErrorMessage="*" 
                    ForeColor="Red" ValidationGroup="signup"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="style7">
                                Address</td>
                            <td class="style2">
                                <asp:TextBox ID="txtAddress" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" 
                                    ControlToValidate="txtAddress" ErrorMessage="*" 
                    ForeColor="Red" ValidationGroup="signup"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="style7">
                                Phone No.</td>
                            <td class="style2">
                                <asp:TextBox ID="txtPhoneNo" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" 
                                    ControlToValidate="txtPhoneNo" ErrorMessage="*" 
                    ForeColor="Red" ValidationGroup="signup"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="style7">
                                Email</td>
                            <td class="style2">
                                <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" 
                                    ControlToValidate="txtEmail" ErrorMessage="*" 
                    ForeColor="Red" ValidationGroup="signup"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="style7">
                                Sex</td>
                            <td class="style2" align="left">
                                <asp:DropDownList ID="drlSex" runat="server">
                                    <asp:ListItem>Male</asp:ListItem>
                                    <asp:ListItem>Female</asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="style7">
                                Age</td>
                            <td class="style2" align="left">
                                <asp:DropDownList ID="drlAge" runat="server" 
                    Height="16px" Width="55px">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="style7">
                                &nbsp;Type</td>
                            <td align="left" class="style2">
                                <asp:DropDownList ID="drlType" runat="server" DataSourceID="SqlDataSource2" 
                                    DataTextField="Name" DataValueField="Id" Height="18px" Width="140px">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="style7">
                                Credit Card No.</td>
                            <td class="style2" align="left">
                                <asp:DropDownList ID="drlCredit" runat="server" 
                    DataSourceID="SqlDataSource1" DataTextField="Code" DataValueField="Code" 
                    Height="16px" Width="141px">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td align="right" class="style7">
                                Passport</td>
                            <td class="style2" align="left">
                                <asp:TextBox ID="txtPassport" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" 
                                    ControlToValidate="txtPassport" ErrorMessage="*" 
                    ForeColor="Red" ValidationGroup="signup" Display="Dynamic"></asp:RequiredFieldValidator>
                                <asp:CustomValidator ID="CustomValidator1" runat="server" 
                                    ControlToValidate="txtPassport" Display="Dynamic" 
                                    ErrorMessage="Passport aldready exists" ForeColor="Red" 
                                    onservervalidate="CustomValidator1_ServerValidate" ValidationGroup="signup"></asp:CustomValidator>
                            </td>
                        </tr>
                        <tr>
                            <td class="style7" align="center">
                                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:airplaneConnectionString %>" 
                    
                    
                    
                                    SelectCommand="SELECT Code FROM CreditCard WHERE (Code NOT IN (SELECT CreditCard FROM Member WHERE (CreditCard IS NOT NULL)))">
                                </asp:SqlDataSource>
                            </td>
                            <td class="style2" align="center">
                                <asp:Button ID="btnLogIn" runat="server" Text="Create User" Font-Bold="True" 
                    Width="98px" onclick="btnLogIn_Click" 
                    ValidationGroup="signup" />
                            </td>
                        </tr>
                        <tr>
                            <td align="center" class="style7" colspan="2">
                                <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:airplaneConnectionString %>" 
                                    SelectCommand="SELECT * FROM [CustomerType]"></asp:SqlDataSource>
                            </td>
                        </tr>
                    </table>
                </asp:Panel>
            </td>
        </tr>
        <tr>
            <td align="center">
                <asp:Panel ID="Panel2" runat="server" Visible="False">
                    <asp:Label ID="Label2" runat="server" Text="Sign up successful !!!"></asp:Label>
                </asp:Panel>
            </td>
        </tr>
    </table>
</asp:Content>

